package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.EmpRuleAddDTO;
import org.jsola.hr.dto.EmpRuleBatchAddDTO;
import org.jsola.hr.dto.SalaryCalculateRuleAddDTO;
import org.jsola.hr.dto.SalaryCalculateRuleUpdateDTO;
import org.jsola.hr.query.CalculatePayQuery;
import org.jsola.hr.query.SalaryCalculateRuleEmpInfoQuery;
import org.jsola.hr.query.SalaryCalculateRuleQuery;
import org.jsola.hr.vo.*;

import java.util.List;

/**
 * 工价计算规则
 *
 * @author zhr
 */
@Api(tags = "hr-工价计算规则")
public interface ISalaryCalculateRuleControllerAPI {

    /**
     * 新增工价计算规则
     * @param salaryCalculateRuleAddDTO 工价计算规则新增实体
     * @return 工价计算规则展示对象
     */
    @ApiOperation(value = "新增工价计算规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "salaryCalculateRuleAddDTO", dataType = "SalaryCalculateRuleAddDTO", value = "新增工价计算规则", paramType = "body")
    })
    Result<SalaryCalculateRuleVO> save(SalaryCalculateRuleAddDTO salaryCalculateRuleAddDTO);


    /**
     * 修改工价计算规则
     * @param salaryCalculateRuleUpdateDTO 工价计算规则
     * @return 更新数量
     */
    @ApiOperation(value = "修改工价计算规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "salaryCalculateRuleUpdateDTO", dataType = "SalaryCalculateRuleUpdateDTO", value = "修改工价计算规则", paramType = "body")
    })
    Result<Integer> update(SalaryCalculateRuleUpdateDTO salaryCalculateRuleUpdateDTO);




    /**
     * 删除单个工价计算规则，彻底删除
     * @param salaryCalculateRuleId 工价计算规则id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个工价计算规则，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "salaryCalculateRuleId", dataType = "String", value = "工价计算规则id", paramType = "path")
    })
    Result<Integer> delete(String salaryCalculateRuleId);


    /**
     * 批量删除工价计算规则，彻底删除
     * @param salaryCalculateRuleIds 工价计算规则id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除工价计算规则，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "salaryCalculateRuleIds", dataType = "String[]", value = "工价计算规则id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] salaryCalculateRuleIds);


    /**
     * 根据工价计算规则id查询工价计算规则详情
     * @param salaryCalculateRuleId 工价计算规则id
     * @return 工价计算规则详情
     */
    @ApiOperation(value="根据工价计算规则id查询工价计算规则详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "salaryCalculateRuleId", dataType = "String", value = "工价计算规则id", paramType = "path")
    })
    Result<SalaryCalculateRuleVO> findById(String salaryCalculateRuleId);


    /**
     * 查询工价计算规则
     * @param salaryCalculateRuleQuery 工价计算规则查询参数
     * @return page
     */
    @ApiOperation(value="查询工价计算规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "salaryCalculateRuleQuery", dataType = "SalaryCalculateRuleQuery", value = "工价计算规则查询参数", paramType = "query")
    })
    Result<List<SalaryCalculateRuleListVO>> listAll(SalaryCalculateRuleQuery salaryCalculateRuleQuery);


     /**
     * 分页查询工价计算规则
     * @param salaryCalculateRuleQuery 工价计算规则查询参数
     * @return page
     */
    @ApiOperation(value="分页查询工价计算规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "salaryCalculateRuleQuery", dataType = "SalaryCalculateRuleQuery", value = "工价计算规则查询参数", paramType = "query")
    })
    Result<Page<SalaryCalculateRuleListVO>> page(SalaryCalculateRuleQuery salaryCalculateRuleQuery);

    /**
     * 计算薪资
     * @param calculatePayQuery 薪资计算需要的参数
     * @return 薪资返回对象
     */
    @ApiOperation(value="计算薪资")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "calculatePayQuery", dataType = "CalculatePayQuery", value = "薪资计算需要的参数", paramType = "body")
    })
    Result<CalculatePayVO> calculatePay(CalculatePayQuery calculatePayQuery);

    /**
     * 计算薪资(优化后)
     * @param calculatePayQuery 薪资计算需要的参数
     * @return 薪资返回对象
     */
    @ApiOperation(value="计算薪资")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "calculatePayQuery", dataType = "CalculatePayQuery", value = "薪资计算需要的参数", paramType = "body")
    })
    Result<CalculatePayVO> newCalculatePay(CalculatePayQuery calculatePayQuery);


    /**
     * 根据规则id查询使用的员工信息
     * @param salaryCalculateRuleEmpInfoQuery 工价规则使用人员查询
     * @return 员工列表
     */
    @ApiOperation(value="根据规则id查询使用的员工信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "salaryCalculateRuleEmpInfoQuery", dataType = "SalaryCalculateRuleEmpInfoQuery", value = "工价规则使用人员查询", paramType = "query")
    })
    Result<Page<EmpInfoVO>> selectEmpInfoVoBySalaryCalculateRuleId(SalaryCalculateRuleEmpInfoQuery salaryCalculateRuleEmpInfoQuery);


    /**
     * 工价薪资档案，初版为外包薪资档案，后来改版，不改方法名了
     *
     * @param salaryCalculateRuleEmpInfoQuery 工价规则使用人员查询
     * @return 员工列表
     */
    @ApiOperation(value="计时制薪资档案")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "salaryCalculateRuleEmpInfoQuery", dataType = "SalaryCalculateRuleEmpInfoQuery", value = "工价规则使用人员查询", paramType = "query")
    })
    Result<Page<EmpInfoSalaryVO>> selectOutsourceSalary(SalaryCalculateRuleEmpInfoQuery salaryCalculateRuleEmpInfoQuery);

    /**
     * 根据员工id查询工价计算规则,劳务费计算规则
     *
     * @param empId 员工id
     * @return 工价计算规则, 劳务费计算规则对象
     */
    @ApiOperation(value = "根据员工id查询工价计算规则,劳务费计算规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empId", dataType = "String", value = "员工id", paramType = "param")
    })
    Result<EmpInfoSalaryVO> selectRuleByEmpId(String empId);

    /**
     * 保存员工工价计算规则
     *
     * @param empRuleAddDTO 计薪规则和劳务费规则参数
     * @return 员工工价规则对象
     */
    @ApiOperation(value = "保存员工工价计算规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empRuleAddDTO", dataType = "EmpRuleAddDTO", value = "工价规则使用人员查询", paramType = "body")
    })
    Result<EmpInfoSalaryVO> saveSalaryCalculateRule(EmpRuleAddDTO empRuleAddDTO);

    /**
     * 批量保存员工工价计算规则
     *
     * @param empRuleBatchAddDTO 计薪规则和劳务费规则参数
     * @return 员工工价规则对象
     */
    @ApiOperation(value = "批量保存员工工价计算规则")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empRuleBatchAddDTO", dataType = "EmpRuleBatchAddDTO", value = "工价规则使用人员查询", paramType = "body")
    })
    Result<Integer> batchSaveSalaryCalculateRule(EmpRuleBatchAddDTO empRuleBatchAddDTO);
}

